home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / PPCToolbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  24.8 KB  |  628 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        PPCToolbox.h
  3.  
  4.      Contains:    Program-Program Communications Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 9
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1989-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __PPCTOOLBOX__
  18. #define __PPCTOOLBOX__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __APPLETALK__
  25.     #include <AppleTalk.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51.  
  52. typedef UInt8 PPCServiceType;
  53. enum {
  54.     ppcServiceRealTime            = 1
  55. };
  56.  
  57.  
  58. typedef SInt16 PPCLocationKind;
  59. enum {
  60.     ppcNoLocation                = 0,                            /* There is no PPCLocName */
  61.     ppcNBPLocation                = 1,                            /* Use AppleTalk NBP      */
  62.     ppcNBPTypeLocation            = 2,                            /* Used for specifying a location name type during PPCOpen only */
  63.     ppcXTIAddrLocation            = 3                                /* Use TCP/IP or DNS host name address */
  64. };
  65.  
  66.  
  67. typedef SInt16 PPCPortKinds;
  68. enum {
  69.     ppcByCreatorAndType            = 1,                            /* Port type is specified as colloquial Mac creator and type */
  70.     ppcByString                    = 2                                /* Port type is in pascal string format */
  71. };
  72.  
  73. /* Values returned for request field in PPCInform call */
  74.  
  75. typedef UInt8 PPCSessionOrigin;
  76. enum {
  77.     ppcLocalOrigin                = 1,                            /* session originated from this machine */
  78.     ppcRemoteOrigin                = 2                                /* session originated from remote machine */
  79. };
  80.  
  81.  
  82. typedef short                             PPCPortRefNum;
  83. typedef long                             PPCSessRefNum;
  84.  
  85.  
  86. /*    The maximum allowed size of a fAddress in PPCXTIAddress */
  87. enum {
  88.     kMaxPPCXTIAddress            = 95
  89. };
  90.  
  91.  
  92. /*    
  93.     The possible types of information found in the fAddressType field of a PPCXTIAddress record
  94.     Note:    These constants are the same as the AF_INET & AF_DNS constants, defined in OpenTptInternet.x
  95. */
  96.  
  97. typedef SInt16 PPCXTIAddressType;
  98. enum {
  99.     kINETAddrType                = 2,                            /*    An IP address in binary form (type InetHost).*/
  100.     kDNSAddrType                = 42                            /*    A DNS or dotted-decimal name string (no leading length byte, no NULL termination byte)*/
  101. };
  102.  
  103.  
  104. /*    
  105.     This structure specifies a transport independent network address in a 
  106.     form that can be used by Open Transport, or as a XTI/TLI/socket network 
  107.     address in UNIX terminology.
  108. */
  109.  
  110. struct PPCXTIAddress {
  111.     PPCXTIAddressType                 fAddressType;                /* A constant specifying what kind of network address this is */
  112.     UInt8                             fAddress[96];                /* The contents of the network address (variable length, NULL terminated). */
  113. };
  114. typedef struct PPCXTIAddress            PPCXTIAddress;
  115. typedef PPCXTIAddress *                    PPCXTIAddressPtr;
  116.  
  117.  
  118. /*
  119.     This structure is the variant type used in a LocationNameRec when an IP connection
  120.     is being established for a PPC Toolbox session.
  121.     
  122.     NOTE: The value of the xtiAddrLen must be the length of the entire PPCXTIAddress structure 
  123.     in the xtiAddr field, and not just the length of the fAddress field of the PPCXTIAddress structure.
  124. */
  125.  
  126. struct PPCAddrRec {
  127.     UInt8                             Reserved[3];                /* reserved - must be initialize to 0                */
  128.     UInt8                             xtiAddrLen;                    /* size of the xtiAddr field                        */
  129.     PPCXTIAddress                     xtiAddr;                    /* the transport-independent network address        */
  130. };
  131. typedef struct PPCAddrRec                PPCAddrRec;
  132. typedef PPCAddrRec *                    PPCAddrRecPtr;
  133.  
  134.  
  135. struct LocationNameRec {
  136.     PPCLocationKind                 locationKindSelector;        /* which variant */
  137.     union {
  138.         EntityName                         nbpEntity;                /* NBP name entity                            */
  139.         Str32                             nbpType;                /* just the NBP type string, for PPCOpen    */
  140.         PPCAddrRec                         xtiType;                /* an XTI-type network address record        */
  141.     }                                 u;
  142. };
  143. typedef struct LocationNameRec            LocationNameRec;
  144.  
  145. typedef LocationNameRec *                LocationNamePtr;
  146.  
  147.  
  148. struct PPCPortRec {
  149.     ScriptCode                         nameScript;                    /* script of name */
  150.     Str32Field                         name;                        /* name of port as seen in browser */
  151.     PPCPortKinds                     portKindSelector;            /* which variant */
  152.     union {
  153.         Str32                             portTypeStr;            /* pascal type string */
  154.         struct {
  155.             OSType                             portCreator;
  156.             OSType                             portType;
  157.         }                                 port;
  158.     }                                 u;
  159. };
  160. typedef struct PPCPortRec                PPCPortRec;
  161.  
  162. typedef PPCPortRec *                    PPCPortPtr;
  163.  
  164. struct PortInfoRec {
  165.     SInt8                             filler1;
  166.     Boolean                         authRequired;
  167.     PPCPortRec                         name;
  168. };
  169. typedef struct PortInfoRec                PortInfoRec;
  170.  
  171. typedef PortInfoRec *                    PortInfoPtr;
  172. typedef PortInfoRec *                    PortInfoArrayPtr;
  173. typedef union PPCParamBlockRec             PPCParamBlockRec;
  174. typedef PPCParamBlockRec *                PPCParamBlockPtr;
  175. typedef CALLBACK_API( void , PPCCompProcPtr )(PPCParamBlockPtr pb);
  176. typedef STACK_UPP_TYPE(PPCCompProcPtr)                             PPCCompUPP;
  177. #define PPCHeader \
  178.      Ptr            qLink;                   /* PPC's Internal Use */\
  179.      unsigned short csCode;                   /* Requested PPC command */\
  180.      unsigned short intUse;                   /* Internal Use */\
  181.      Ptr            intUsePtr;              /* Internal Use */\
  182.      PPCCompUPP     ioCompletion;            /* 12 --> Completion Routine */\
  183.      OSErr           ioResult;                  /* 16 <-- Command Result Code */\
  184.      unsigned long    Reserved[5];             /* Reserved for PPC, Don't use */
  185.  
  186.  
  187. struct PPCOpenPBRec {
  188.     Ptr                             qLink;                        /* PPC's Internal Use */
  189.     unsigned short                     csCode;                        /* Requested PPC command */
  190.     unsigned short                     intUse;                        /* Internal Use */
  191.     Ptr                             intUsePtr;                    /* Internal Use */
  192.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  193.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  194.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  195.     PPCPortRefNum                     portRefNum;                    /* 38 <--   Port Reference */
  196.     long                             filler1;
  197.     PPCServiceType                     serviceType;                /* 44 -->    Bit field describing the requested port service */
  198.     UInt8                             resFlag;                    /* Must be set to 0 */
  199.     PPCPortPtr                         portName;                    /* 46 -->   PortName for PPC */
  200.     LocationNamePtr                 locationName;                /* 50 -->   If NBP Registration is required */
  201.     Boolean                         networkVisible;                /* 54 -->   make this network visible on network */
  202.     Boolean                         nbpRegistered;                /* 55 <--   The given location name was registered on the network */
  203. };
  204. typedef struct PPCOpenPBRec                PPCOpenPBRec;
  205.  
  206. typedef PPCOpenPBRec *                    PPCOpenPBPtr;
  207.  
  208. struct PPCInformPBRec {
  209.     Ptr                             qLink;                        /* PPC's Internal Use */
  210.     unsigned short                     csCode;                        /* Requested PPC command */
  211.     unsigned short                     intUse;                        /* Internal Use */
  212.     Ptr                             intUsePtr;                    /* Internal Use */
  213.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  214.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  215.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  216.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  217.     PPCSessRefNum                     sessRefNum;                    /* 40 <--   Session Reference */
  218.     PPCServiceType                     serviceType;                /* 44 <--   Status Flags for type of session, local, remote */
  219.     Boolean                         autoAccept;                    /* 45 -->   if true session will be accepted automatically */
  220.     PPCPortPtr                         portName;                    /* 46 -->   Buffer for Source PPCPortRec */
  221.     LocationNamePtr                 locationName;                /* 50 -->   Buffer for Source LocationNameRec */
  222.     StringPtr                         userName;                    /* 54 -->   Buffer for Soure user's name trying to link. */
  223.     unsigned long                     userData;                    /* 58 <--   value included in PPCStart's userData */
  224.     PPCSessionOrigin                 requestType;                /* 62 <--   Local or Network */
  225.     SInt8                             filler;
  226. };
  227. typedef struct PPCInformPBRec            PPCInformPBRec;
  228.  
  229. typedef PPCInformPBRec *                PPCInformPBPtr;
  230.  
  231. struct PPCStartPBRec {
  232.     Ptr                             qLink;                        /* PPC's Internal Use */
  233.     unsigned short                     csCode;                        /* Requested PPC command */
  234.     unsigned short                     intUse;                        /* Internal Use */
  235.     Ptr                             intUsePtr;                    /* Internal Use */
  236.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  237.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  238.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  239.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  240.     PPCSessRefNum                     sessRefNum;                    /* 40 <--   Session Reference */
  241.     PPCServiceType                     serviceType;                /* 44 <--   Actual service method (realTime) */
  242.     UInt8                             resFlag;                    /* 45 -->   Must be set to 0  */
  243.     PPCPortPtr                         portName;                    /* 46 -->   Destination portName */
  244.     LocationNamePtr                 locationName;                /* 50 -->   NBP or NAS style service location name */
  245.     unsigned long                     rejectInfo;                    /* 54 <--   reason for rejecting the session request */
  246.     unsigned long                     userData;                    /* 58 -->   Copied to destination PPCInform parameter block */
  247.     unsigned long                     userRefNum;                    /* 62 -->   userRefNum (obtained during login process)  */
  248. };
  249. typedef struct PPCStartPBRec            PPCStartPBRec;
  250.  
  251. typedef PPCStartPBRec *                    PPCStartPBPtr;
  252.  
  253. struct PPCAcceptPBRec {
  254.     Ptr                             qLink;                        /* PPC's Internal Use */
  255.     unsigned short                     csCode;                        /* Requested PPC command */
  256.     unsigned short                     intUse;                        /* Internal Use */
  257.     Ptr                             intUsePtr;                    /* Internal Use */
  258.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  259.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  260.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  261.     short                             filler1;
  262.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  263. };
  264. typedef struct PPCAcceptPBRec            PPCAcceptPBRec;
  265.  
  266. typedef PPCAcceptPBRec *                PPCAcceptPBPtr;
  267.  
  268. struct PPCRejectPBRec {
  269.     Ptr                             qLink;                        /* PPC's Internal Use */
  270.     unsigned short                     csCode;                        /* Requested PPC command */
  271.     unsigned short                     intUse;                        /* Internal Use */
  272.     Ptr                             intUsePtr;                    /* Internal Use */
  273.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  274.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  275.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  276.     short                             filler1;
  277.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  278.     short                             filler2;
  279.     long                             filler3;
  280.     long                             filler4;
  281.     unsigned long                     rejectInfo;                    /* 54 -->   reason for rejecting the session request  */
  282. };
  283. typedef struct PPCRejectPBRec            PPCRejectPBRec;
  284.  
  285. typedef PPCRejectPBRec *                PPCRejectPBPtr;
  286.  
  287. struct PPCWritePBRec {
  288.     Ptr                             qLink;                        /* PPC's Internal Use */
  289.     unsigned short                     csCode;                        /* Requested PPC command */
  290.     unsigned short                     intUse;                        /* Internal Use */
  291.     Ptr                             intUsePtr;                    /* Internal Use */
  292.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  293.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  294.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  295.     short                             filler1;
  296.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  297.     Size                             bufferLength;                /* 44 -->   Length of the message buffer */
  298.     Size                             actualLength;                /* 48 <--   Actual Length Written */
  299.     Ptr                             bufferPtr;                    /* 52 -->   Pointer to message buffer */
  300.     Boolean                         more;                        /* 56 -->   if more data in this block will be written */
  301.     SInt8                             filler2;
  302.     unsigned long                     userData;                    /* 58 -->   Message block userData Uninterpreted by PPC */
  303.     OSType                             blockCreator;                /* 62 -->   Message block creator Uninterpreted by PPC */
  304.     OSType                             blockType;                    /* 66 -->   Message block type Uninterpreted by PPC */
  305. };
  306. typedef struct PPCWritePBRec            PPCWritePBRec;
  307.  
  308. typedef PPCWritePBRec *                    PPCWritePBPtr;
  309.  
  310. struct PPCReadPBRec {
  311.     Ptr                             qLink;                        /* PPC's Internal Use */
  312.     unsigned short                     csCode;                        /* Requested PPC command */
  313.     unsigned short                     intUse;                        /* Internal Use */
  314.     Ptr                             intUsePtr;                    /* Internal Use */
  315.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  316.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  317.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  318.     short                             filler1;
  319.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  320.     Size                             bufferLength;                /* 44 -->   Length of the message buffer */
  321.     Size                             actualLength;                /* 48 <--   Actual length read */
  322.     Ptr                             bufferPtr;                    /* 52 -->   Pointer to message buffer */
  323.     Boolean                         more;                        /* 56 <--   if true more data in this block to be read */
  324.     SInt8                             filler2;
  325.     unsigned long                     userData;                    /* 58 <--   Message block userData Uninterpreted by PPC */
  326.     OSType                             blockCreator;                /* 62 <--   Message block creator Uninterpreted by PPC */
  327.     OSType                             blockType;                    /* 66 <--   Message block type Uninterpreted by PPC */
  328. };
  329. typedef struct PPCReadPBRec                PPCReadPBRec;
  330.  
  331. typedef PPCReadPBRec *                    PPCReadPBPtr;
  332.  
  333. struct PPCEndPBRec {
  334.     Ptr                             qLink;                        /* PPC's Internal Use */
  335.     unsigned short                     csCode;                        /* Requested PPC command */
  336.     unsigned short                     intUse;                        /* Internal Use */
  337.     Ptr                             intUsePtr;                    /* Internal Use */
  338.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  339.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  340.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  341.     short                             filler1;
  342.     PPCSessRefNum                     sessRefNum;                    /* 40 -->   Session Reference */
  343. };
  344. typedef struct PPCEndPBRec                PPCEndPBRec;
  345.  
  346. typedef PPCEndPBRec *                    PPCEndPBPtr;
  347.  
  348. struct PPCClosePBRec {
  349.     Ptr                             qLink;                        /* PPC's Internal Use */
  350.     unsigned short                     csCode;                        /* Requested PPC command */
  351.     unsigned short                     intUse;                        /* Internal Use */
  352.     Ptr                             intUsePtr;                    /* Internal Use */
  353.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  354.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  355.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  356.     PPCPortRefNum                     portRefNum;                    /* 38 -->   Port Identifier */
  357. };
  358. typedef struct PPCClosePBRec            PPCClosePBRec;
  359.  
  360. typedef PPCClosePBRec *                    PPCClosePBPtr;
  361.  
  362. struct IPCListPortsPBRec {
  363.     Ptr                             qLink;                        /* PPC's Internal Use */
  364.     unsigned short                     csCode;                        /* Requested PPC command */
  365.     unsigned short                     intUse;                        /* Internal Use */
  366.     Ptr                             intUsePtr;                    /* Internal Use */
  367.     PPCCompUPP                         ioCompletion;                /* 12 -->    Completion Routine */
  368.     OSErr                             ioResult;                    /* 16 <--     Command Result Code */
  369.     unsigned long                     Reserved[5];                /* Reserved for PPC, Don't use */
  370.     short                             filler1;
  371.     unsigned short                     startIndex;                    /* 40 -->   Start Index */
  372.     unsigned short                     requestCount;                /* 42 -->   Number of entries to be returned */
  373.     unsigned short                     actualCount;                /* 44 <--   Actual Number of entries to be returned */
  374.     PPCPortPtr                         portName;                    /* 46 -->   PortName Match */
  375.     LocationNamePtr                 locationName;                /* 50 -->   NBP or NAS type name to locate the Port Location */
  376.     PortInfoArrayPtr                 bufferPtr;                    /* 54 -->   Pointer to a buffer requestCount*sizeof(PortInfo) bytes big */
  377. };
  378. typedef struct IPCListPortsPBRec        IPCListPortsPBRec;
  379.  
  380. typedef IPCListPortsPBRec *                IPCListPortsPBPtr;
  381.  
  382. union PPCParamBlockRec {
  383.     PPCOpenPBRec                     openParam;
  384.     PPCInformPBRec                     informParam;
  385.     PPCStartPBRec                     startParam;
  386.     PPCAcceptPBRec                     acceptParam;
  387.     PPCRejectPBRec                     rejectParam;
  388.     PPCWritePBRec                     writeParam;
  389.     PPCReadPBRec                     readParam;
  390.     PPCEndPBRec                     endParam;
  391.     PPCClosePBRec                     closeParam;
  392.     IPCListPortsPBRec                 listPortsParam;
  393. };
  394.  
  395. /*  PPC Calling Conventions  */
  396.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  397.                                                                                             #pragma parameter __D0 PPCInit
  398.                                                                                             #endif
  399. EXTERN_API( OSErr )
  400. PPCInit                            (void)                                                        TWOWORDINLINE(0x7000, 0xA0DD);
  401.  
  402.  
  403.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  404.                                                                                             #pragma parameter __D0 PPCOpenSync(__A0)
  405.                                                                                             #endif
  406. EXTERN_API( OSErr )
  407. PPCOpenSync                        (PPCOpenPBPtr             pb)                                    TWOWORDINLINE(0x7001, 0xA0DD);
  408.  
  409.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  410.                                                                                             #pragma parameter __D0 PPCOpenAsync(__A0)
  411.                                                                                             #endif
  412. EXTERN_API( OSErr )
  413. PPCOpenAsync                    (PPCOpenPBPtr             pb)                                    TWOWORDINLINE(0x7001, 0xA4DD);
  414.  
  415.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  416.                                                                                             #pragma parameter __D0 PPCInformSync(__A0)
  417.                                                                                             #endif
  418. EXTERN_API( OSErr )
  419. PPCInformSync                    (PPCInformPBPtr         pb)                                    TWOWORDINLINE(0x7003, 0xA0DD);
  420.  
  421.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  422.                                                                                             #pragma parameter __D0 PPCInformAsync(__A0)
  423.                                                                                             #endif
  424. EXTERN_API( OSErr )
  425. PPCInformAsync                    (PPCInformPBPtr         pb)                                    TWOWORDINLINE(0x7003, 0xA4DD);
  426.  
  427.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  428.                                                                                             #pragma parameter __D0 PPCStartSync(__A0)
  429.                                                                                             #endif
  430. EXTERN_API( OSErr )
  431. PPCStartSync                    (PPCStartPBPtr             pb)                                    TWOWORDINLINE(0x7002, 0xA0DD);
  432.  
  433.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  434.                                                                                             #pragma parameter __D0 PPCStartAsync(__A0)
  435.                                                                                             #endif
  436. EXTERN_API( OSErr )
  437. PPCStartAsync                    (PPCStartPBPtr             pb)                                    TWOWORDINLINE(0x7002, 0xA4DD);
  438.  
  439.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  440.                                                                                             #pragma parameter __D0 PPCAcceptSync(__A0)
  441.                                                                                             #endif
  442. EXTERN_API( OSErr )
  443. PPCAcceptSync                    (PPCAcceptPBPtr         pb)                                    TWOWORDINLINE(0x7004, 0xA0DD);
  444.  
  445.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  446.                                                                                             #pragma parameter __D0 PPCAcceptAsync(__A0)
  447.                                                                                             #endif
  448. EXTERN_API( OSErr )
  449. PPCAcceptAsync                    (PPCAcceptPBPtr         pb)                                    TWOWORDINLINE(0x7004, 0xA4DD);
  450.  
  451.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  452.                                                                                             #pragma parameter __D0 PPCRejectSync(__A0)
  453.                                                                                             #endif
  454. EXTERN_API( OSErr )
  455. PPCRejectSync                    (PPCRejectPBPtr         pb)                                    TWOWORDINLINE(0x7005, 0xA0DD);
  456.  
  457.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  458.                                                                                             #pragma parameter __D0 PPCRejectAsync(__A0)
  459.                                                                                             #endif
  460. EXTERN_API( OSErr )
  461. PPCRejectAsync                    (PPCRejectPBPtr         pb)                                    TWOWORDINLINE(0x7005, 0xA4DD);
  462.  
  463.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  464.                                                                                             #pragma parameter __D0 PPCWriteSync(__A0)
  465.                                                                                             #endif
  466. EXTERN_API( OSErr )
  467. PPCWriteSync                    (PPCWritePBPtr             pb)                                    TWOWORDINLINE(0x7006, 0xA0DD);
  468.  
  469.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  470.                                                                                             #pragma parameter __D0 PPCWriteAsync(__A0)
  471.                                                                                             #endif
  472. EXTERN_API( OSErr )
  473. PPCWriteAsync                    (PPCWritePBPtr             pb)                                    TWOWORDINLINE(0x7006, 0xA4DD);
  474.  
  475.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  476.                                                                                             #pragma parameter __D0 PPCReadSync(__A0)
  477.                                                                                             #endif
  478. EXTERN_API( OSErr )
  479. PPCReadSync                        (PPCReadPBPtr             pb)                                    TWOWORDINLINE(0x7007, 0xA0DD);
  480.  
  481.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  482.                                                                                             #pragma parameter __D0 PPCReadAsync(__A0)
  483.                                                                                             #endif
  484. EXTERN_API( OSErr )
  485. PPCReadAsync                    (PPCReadPBPtr             pb)                                    TWOWORDINLINE(0x7007, 0xA4DD);
  486.  
  487.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  488.                                                                                             #pragma parameter __D0 PPCEndSync(__A0)
  489.                                                                                             #endif
  490. EXTERN_API( OSErr )
  491. PPCEndSync                        (PPCEndPBPtr             pb)                                    TWOWORDINLINE(0x7008, 0xA0DD);
  492.  
  493.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  494.                                                                                             #pragma parameter __D0 PPCEndAsync(__A0)
  495.                                                                                             #endif
  496. EXTERN_API( OSErr )
  497. PPCEndAsync                        (PPCEndPBPtr             pb)                                    TWOWORDINLINE(0x7008, 0xA4DD);
  498.  
  499.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  500.                                                                                             #pragma parameter __D0 PPCCloseSync(__A0)
  501.                                                                                             #endif
  502. EXTERN_API( OSErr )
  503. PPCCloseSync                    (PPCClosePBPtr             pb)                                    TWOWORDINLINE(0x7009, 0xA0DD);
  504.  
  505.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  506.                                                                                             #pragma parameter __D0 PPCCloseAsync(__A0)
  507.                                                                                             #endif
  508. EXTERN_API( OSErr )
  509. PPCCloseAsync                    (PPCClosePBPtr             pb)                                    TWOWORDINLINE(0x7009, 0xA4DD);
  510.  
  511.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  512.                                                                                             #pragma parameter __D0 IPCListPortsSync(__A0)
  513.                                                                                             #endif
  514. EXTERN_API( OSErr )
  515. IPCListPortsSync                (IPCListPortsPBPtr         pb)                                    TWOWORDINLINE(0x700A, 0xA0DD);
  516.  
  517.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  518.                                                                                             #pragma parameter __D0 IPCListPortsAsync(__A0)
  519.                                                                                             #endif
  520. EXTERN_API( OSErr )
  521. IPCListPortsAsync                (IPCListPortsPBPtr         pb)                                    TWOWORDINLINE(0x700A, 0xA4DD);
  522.  
  523.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  524.                                                                                             #pragma parameter __D0 IPCKillListPorts(__A0)
  525.                                                                                             #endif
  526. EXTERN_API( OSErr )
  527. IPCKillListPorts                (IPCListPortsPBPtr         pb)                                    TWOWORDINLINE(0x700B, 0xA0DD);
  528.  
  529. EXTERN_API( OSErr )
  530. DeleteUserIdentity                (unsigned long             userRef);
  531.  
  532. EXTERN_API( OSErr )
  533. GetDefaultUser                    (unsigned long *        userRef,
  534.                                  Str32                     userName);
  535.  
  536. EXTERN_API( OSErr )
  537. StartSecureSession                (PPCStartPBPtr             pb,
  538.                                  Str32                     userName,
  539.                                  Boolean                 useDefault,
  540.                                  Boolean                 allowGuest,
  541.                                  Boolean *                guestSelected,
  542.                                  ConstStr255Param         prompt);
  543.  
  544. typedef CALLBACK_API( Boolean , PPCFilterProcPtr )(LocationNamePtr name, PortInfoPtr port);
  545. typedef STACK_UPP_TYPE(PPCFilterProcPtr)                         PPCFilterUPP;
  546. #if OPAQUE_UPP_TYPES
  547.     EXTERN_API(PPCCompUPP)
  548.     NewPPCCompUPP                   (PPCCompProcPtr            userRoutine);
  549.  
  550.     EXTERN_API(PPCFilterUPP)
  551.     NewPPCFilterUPP                   (PPCFilterProcPtr        userRoutine);
  552.  
  553.     EXTERN_API(void)
  554.     DisposePPCCompUPP               (PPCCompUPP                userUPP);
  555.  
  556.     EXTERN_API(void)
  557.     DisposePPCFilterUPP               (PPCFilterUPP            userUPP);
  558.  
  559.     EXTERN_API(void)
  560.     InvokePPCCompUPP               (PPCParamBlockPtr        pb,
  561.                                     PPCCompUPP                userUPP);
  562.  
  563.     EXTERN_API(Boolean)
  564.     InvokePPCFilterUPP               (LocationNamePtr            name,
  565.                                     PortInfoPtr                port,
  566.                                     PPCFilterUPP            userUPP);
  567.  
  568. #else
  569.     enum { uppPPCCompProcInfo = 0x000000C0 };                         /* pascal no_return_value Func(4_bytes) */
  570.     enum { uppPPCFilterProcInfo = 0x000003D0 };                     /* pascal 1_byte Func(4_bytes, 4_bytes) */
  571.     #define NewPPCCompUPP(userRoutine)                                 (PPCCompUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCCompProcInfo, GetCurrentArchitecture())
  572.     #define NewPPCFilterUPP(userRoutine)                             (PPCFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPPCFilterProcInfo, GetCurrentArchitecture())
  573.     #define DisposePPCCompUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  574.     #define DisposePPCFilterUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  575.     #define InvokePPCCompUPP(pb, userUPP)                             CALL_ONE_PARAMETER_UPP((userUPP), uppPPCCompProcInfo, (pb))
  576.     #define InvokePPCFilterUPP(name, port, userUPP)                 (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppPPCFilterProcInfo, (name), (port))
  577. #endif
  578. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  579. #define NewPPCCompProc(userRoutine)                             NewPPCCompUPP(userRoutine)
  580. #define NewPPCFilterProc(userRoutine)                             NewPPCFilterUPP(userRoutine)
  581. #define CallPPCCompProc(userRoutine, pb)                        InvokePPCCompUPP(pb, userRoutine)
  582. #define CallPPCFilterProc(userRoutine, name, port)                InvokePPCFilterUPP(name, port, userRoutine)
  583. EXTERN_API( OSErr )
  584. PPCBrowser                        (ConstStr255Param         prompt,
  585.                                  ConstStr255Param         applListLabel,
  586.                                  Boolean                 defaultSpecified,
  587.                                  LocationNameRec *        theLocation,
  588.                                  PortInfoRec *            thePortInfo,
  589.                                  PPCFilterUPP             portFilter,
  590.                                  ConstStr32Param         theLocNBPType)                        THREEWORDINLINE(0x303C, 0x0D00, 0xA82B);
  591.  
  592.  
  593. /*
  594.   The ParamBlock calls without the "Sync" or "Async" suffix are being phased out.
  595. */
  596. #define PPCOpen(pb, async)      ((async) ? PPCOpenAsync(pb)      : PPCOpenSync(pb))
  597. #define PPCInform(pb, async)    ((async) ? PPCInformAsync(pb)    : PPCInformSync(pb))
  598. #define PPCStart(pb, async)     ((async) ? PPCStartAsync(pb)     : PPCStartSync(pb))
  599. #define PPCAccept(pb, async)    ((async) ? PPCAcceptAsync(pb)    : PPCAcceptSync(pb))
  600. #define PPCReject(pb, async)    ((async) ? PPCRejectAsync(pb)    : PPCRejectSync(pb))
  601. #define PPCWrite(pb, async)     ((async) ? PPCWriteAsync(pb)     : PPCWriteSync(pb))
  602. #define PPCRead(pb, async)      ((async) ? PPCReadAsync(pb)      : PPCReadSync(pb))
  603. #define PPCEnd(pb, async)       ((async) ? PPCEndAsync(pb)       : PPCEndSync(pb))
  604. #define PPCClose(pb, async)     ((async) ? PPCCloseAsync(pb)     : PPCCloseSync(pb))
  605. #define IPCListPorts(pb, async) ((async) ? IPCListPortsAsync(pb) : IPCListPortsSync(pb))
  606.  
  607.  
  608. #if PRAGMA_STRUCT_ALIGN
  609.     #pragma options align=reset
  610. #elif PRAGMA_STRUCT_PACKPUSH
  611.     #pragma pack(pop)
  612. #elif PRAGMA_STRUCT_PACK
  613.     #pragma pack()
  614. #endif
  615.  
  616. #ifdef PRAGMA_IMPORT_OFF
  617. #pragma import off
  618. #elif PRAGMA_IMPORT
  619. #pragma import reset
  620. #endif
  621.  
  622. #ifdef __cplusplus
  623. }
  624. #endif
  625.  
  626. #endif /* __PPCTOOLBOX__ */
  627.  
  628.